package org.chaiyi.template.core.common.util.asserts;


import java.math.BigDecimal;

class BigDecimalAssert {
    private final BigDecimal value;

    public BigDecimalAssert(BigDecimal value) {
        this.value = value;
    }

    public boolean lt(BigDecimal value) {
        return this.value.compareTo(value) < 0;
    }

    public boolean lte(BigDecimal value) {
        return this.value.compareTo(value) <= 0;
    }

    public boolean gte(BigDecimal value) {
        return this.value.compareTo(value) >= 0;
    }

    public boolean gt(BigDecimal value) {
        return this.value.compareTo(value) > 0;
    }

    public boolean eq(BigDecimal value) {
        return this.value.compareTo(value) == 0;
    }

    public boolean in(BigDecimal from, BigDecimal to) {
        return this.gte(from) && this.lte(to);
    }

    public boolean zero() {
        return this.value.equals(BigDecimal.ZERO);
    }
}
